import lejos.nxt.*;
import lejos.robotics.navigation.Pilot;
import lejos.robotics.navigation.SimpleNavigator;

public class NavigationCar
{
	private static Pilot pilot;
	private static SimpleNavigator navigator;
	//private static float destX, destY;

	private NavigationCar() {
    }
    
    public static void initialize(Pilot newPilot) throws Exception {
    	pilot = newPilot;
    	navigator = new SimpleNavigator(newPilot);
    }
    
    public static void goTo(float x, float y) {
    	//destX = x;
    	//destY = y;
    	navigator.goTo(x, y);
    	//destX = destY = -1000; //TODO: blah
    }
    
    public static void rotate(float angle) {
    	navigator.rotate(angle);
    }
    
    public static void rotateTo(float angle) {
    	navigator.rotateTo(angle);
    }
    
    public static void update() {
    	navigator.updatePose();
    	navigator.updatePosition();
    }
    
    public static void travel(float distance) {
    	navigator.travel(distance);
    }
    
    public static float getAngle() {
    	return navigator.getAngle();
    }
    
    public static float getX() {
    	return navigator.getX();
    }
    
    public static float getY() {
    	return navigator.getY();
    }
    
    /*public static float getDestX() {
		return destX;
	}*/

	/*public static float getDestY() {
		return destY;
	}*/
	
	public static void stop() {
		//destX = destY = 0;
		navigator.stop();
	}
    
}
